package cn.anjubao.cp.api.common;

import java.util.Arrays;
import java.util.Optional;

public enum BussinessType {

    PARKING(1),
    BALANCE(2),
    ;

    public int value;
    private BussinessType(int value) {
        this.value = value;
    }

    public static BussinessType getByValue(int v) {
        Optional<BussinessType> o = Arrays.asList(BussinessType.values())
                .stream().filter(item -> v == item.value)
                .findFirst();
        if (o.isPresent()) {
            return o.get();
        }
        return null;
    }
}
